<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>注册</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #fff0f5;
            margin: 0;
            padding: 0;
            display: flex;
            flex-direction: column;
            align-items: center;
            min-height: 100vh;
            background-size: cover;
        }
        .container {
            background-color: rgba(255, 255, 255, 0.95);
            padding: 30px;
            border-radius: 10px;
            text-align: center;
            margin-top: 30px;
            width: 90%;
            max-width: 400px;
            box-shadow: 0 0 20px rgba(0,0,0,0.1);
        }
        h1 {
            color: #333;
        }
        form {
            margin: 20px 0;
        }
        label {
            font-size: 18px;
            color: #555;
        }
        input[type="text"], input[type="password"], select {
            padding: 10px;
            margin: 10px 0;
            width: 80%;
            border: 1px solid #ccc;
            border-radius: 5px;
        }
        button {
            padding: 10px 25px;
            background-color: #28a745;
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 16px;
        }
        button:hover {
            background-color: #218838;
        }
        .error {
            color: red;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>注册</h1>
<!--        {% if error %}-->
            <p class="error">{{ error }}</p>
<!--        {% endif %}-->
        <form method="POST">
            <label for="name">姓名：</label><br>
            <input type="text" id="name" name="name" required><br>

            <label for="password">密码：</label><br>
            <input type="password" id="password" name="password" required><br>

            <label for="role">角色：</label><br>
            <select id="role" name="role" required>
                <option value="">请选择角色</option>
                <option value="teacher">教师</option>
                <option value="student">学生</option>
            </select><br>

            <button type="submit">注册</button>
        </form>
        <p>已经有账户？ <a href="/login">登录</a></p>
    </div>
</body>
</html>